package com.up.stores.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.up.stores.entity.Category;
import com.up.stores.mapper.CategoryMapper;
import com.up.stores.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class CategoryServiceImpl implements ICategoryService {
    @Autowired
    CategoryMapper categoryMapper;
    @Override
    public List<Category> getCategory(Integer pid) {
        QueryWrapper<Category>queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("parent",pid);
        List<Category>list=new ArrayList<>();
        categoryMapper.selectList(queryWrapper);
        return list;
    }
}
